 <template>
	<view>
		<uni-list>
			<uni-list-item  title="学生姓名" :note="info.studentName"></uni-list-item>
			<uni-list-item  title="学生电话" :note="info.studentTelephone">
				<template v-slot:footer>
					<view>
						<button>拨打学生电话</button>
					</view>
				</template>
			</uni-list-item>
			<uni-list-item  title="老师电话" :note="info.usersNickTelephone">
				<template v-slot:footer>
					<view>
						<button>拨打老师电话</button>
					</view>
				</template>
			</uni-list-item>
			<uni-list-item  title="请假类型" :note="leavstate[info.leaveType-1]"></uni-list-item>
			<uni-list-item  title="症状" :note="info.onsetSymptoms"></uni-list-item>
			<uni-list-item  title="诊断疾病" :note="info.diagnose"></uni-list-item>
			<uni-list-item  title="诊断时间" :note="info.diagnosisTime"></uni-list-item>
			<uni-list-item  title="发病时间" :note="info.studentName"></uni-list-item>
			<uni-list-item  title="请假开始时间" :note="info.leaveTimeStart"></uni-list-item>
			<uni-list-item  title="请假结束时间" :note="info.leaveTimeEnd"></uni-list-item>
			<uni-list-item  title="请假说明" :note="info.leaveDetailes"></uni-list-item>
			<uni-list-item  title="离校确认人" :note="info.departureConfirmer"></uni-list-item>
			<uni-list-item  title="离校说明" :note="info.departureDetails"></uni-list-item>
		</uni-list>
		
		<view class="">
			<button v-if="!flay" @click="submit">提交</button>
			<button v-else @click="deletebut">删除</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				flay:'',
				text:'',
				leavstate:['事假','病假'],
				info:''
			}
		},
		onLoad(e) {
			this.id=e.id
			this.flay=e.faly
			if(this.flay){
				uni.setNavigationBarTitle({
					title:"请假详细"
				})
				
			}else{
				uni.setNavigationBarTitle({
					title:'离校详细'
				})
			}
			this.getinfo()
		},
		methods: {
			async deletebut(){
				const res=await this.$request.deleteleave({isDetele:1,id:this.id})
				console.log(res)
			},
			submit(){},
			async getinfo(){
				const res =await this.$request.pastinfo(this.id)
				console.log(res)
				this.info=res.data.data
				
			}
		}
	}
</script>

<style>

</style 
